package com.coolingme.auth.v2chain;

import com.coolingme.auth.Member;
import com.coolingme.auth.v2chain.handler.AuthHandler;
import com.coolingme.auth.v2chain.handler.LoginHandler;
import com.coolingme.auth.v2chain.handler.ValidateHandler;

/**
 * 用户登录认证授权
 *
 * @author wangyue
 * @date 2020-09-23 21:43
 */
public class MemberService {

    public void auth(Member member) {
        ValidateHandler validateHandler = new ValidateHandler();
        LoginHandler loginHandler = new LoginHandler();
        AuthHandler authHandler = new AuthHandler();

        // 设置处理链
        validateHandler.setChain(loginHandler);
        loginHandler.setChain(authHandler);

        validateHandler.doAuth(member);
    }


}
